<?php
/**
 * 管理后台-UCenter交互-RCenter
 * 该控制器通过sp内置的spAccess函数存储系统的全局数据，如用户注册许何、默认组等
 * @author Pony
 */
class ucenter extends spController{
	function __construct(){
		if($_SESSION['ucid'] != RC_ADMIN){$this->error('您不是RCenter管理员',spUrl('main','login'));}
		parent::__construct();
	}
	
	function index(){
		$this -> ucenter_path = spClass('spUcenter') -> uc_api_url();
		$this -> tpl_img = TPL_IMG;
		$this -> group_options = spClass('lib_member') -> exGroup();
		$this -> ALLOW_GUEST_REGISTER = spAccess('r','ALLOW_GUEST_REGISTER');
		$this -> GUEST_REGISTER_GROUP = spAccess('r','GUEST_REGISTER_GROUP');
		$this->display('admin_ucenter.htm');
	}
	
	function edit(){
		spAccess('w','ALLOW_GUEST_REGISTER',$this->spArgs('ALLOW_GUEST_REGISTER'));
		spAccess('w','GUEST_REGISTER_GROUP',$this->spArgs('GUEST_REGISTER_GROUP'));
		$this->success('已成功设置',spUrl('ucenter'));
	}
}